<?php
Shop::register('css/shop.css');
$this->breadcrumbs=array(
		Shop::t('Orders')=>array('index'),
		$model->order_id,
		);

?>
<h2> <?php echo Shop::t('Order') ?> <?php echo $model->code; ?></h2>

<h3> <?php echo Shop::t('Ordering Info'); ?> </h3>

<?php $this->widget('zii.widgets.CDetailView', array(
			'data'=>$model,
			'attributes'=>array(
				'order_id',
                array(
                    'label'     => Yii::t('zii', 'Product'),
                    'value'     => Product::model()->findByPk($model->product_id)->name,
                ),
					array(
						'label' => Shop::t('Ordering date'),
						'value' => date('d/m/Y H:i:s',$model->created_time)
					),
				array(
                    'label'     => Yii::t('zii','Status'),
                    'value'     => $model->getStatusName(),
                ),
                array(
                    'label'     => Yii::t('zii', 'Amount'),
                    'value'     => $model->amount,
                )
				),
			)); ?>

<h3> <?php echo Yii::t('zii','Distributor Info'); ?> </h3>

<?php $this->widget('zii.widgets.CDetailView', array(
			'data'=>Users::model()->findByPk($model->distributor_id),
			'attributes'=>array(
				'full_name',
                'email',
                'address',
                'province'
				),
			)); ?>

<?php 
$this->renderPartial('/paymentMethod/view', array(
	'model' => $model)); 
$this->renderPartial('/shippingMethod/view', array(
	'model' => $model)); 
?>

<div style="clear:both;"> </div>

<div class="buttons"> 
<?php

echo CHtml::link(Shop::t('Delivery slip'), array(
			'//supplier/order/slip', 'id' => $model->order_id )); 

echo CHtml::link(Shop::t('Invoice'), array(
			'//supplier/order/invoice', 'id' => $model->order_id)); 

echo CHtml::link(Shop::t('Back to Orders'), array(
			'//shop/order/admin')); 

?>
</div>
